<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="/page" prefix="public"%>
<public:pageControl classPath="app.portalbs.basic.user.role.RoleList" />

<script language="javascript">
	
	function roleAuthBtn_onclick(grid,page){
		
		var roleIds="";
		grid.getCheckDataSet();
		if(grid.getRecordCount()<1) {
			alert("请选择至少一个角色！");
			return;
		}
		while(grid.next()){
			var roleId = grid.getFieldValue("role_id");
			roleIds+=roleId+",";
		}
		
		var dataSet = new Yacon.data.DataSet(page);
		dataSet.setWhereField("roleIds",roleIds);
		dataSet.setWhereField("operKey",page.element.parameter.operKey);
		dataSet.switchMessage("saveRoles");
		
		grid.refresh();
		
	}
</script>

